package com.share.netdisk.file.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.share.netdisk.file.pojo.File;
import com.share.netdisk.file.pojo.UserFile;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FileDao extends BaseMapper<File> {

    String selectParentFile(@Param("userId") Long userId, @Param("parentId") Long parentId);
    String selectFile(@Param("userId") Long userId, @Param("fileId") Long fileId);
    File selectFileEntity(@Param("userId") Long userId, @Param("fileId") Long fileId);
    int insertHomeFile(UserFile userFile);
    int updateStatus(@Param("userId") Long userId, @Param("fileId") Long fileId);
    int updateParentPath(@Param("userId") Long userId, @Param("srcFileId") Long srcFileId, @Param("dstFileId") Long dstFileId,@Param("dbPath") String dbPath);

    int updateFileUrl(@Param("userId") Long userId, @Param("fileId") Long fileId, @Param("newFilePath") String newFilePath);

    IPage<File> selectFileEntitys(@Param("userId") Long userId, @Param("fileId") Long fileId);

    File selectFileBy(@Param("userId") Long userId,@Param("path") String path);

    int insertFile(File userFile);

    List<File> selectFileList(Long userId);

    List<File> selectFileByPath(@Param("userId") Long userId, @Param("path") String path);

    List<File> selectFilesByUserAndPaths(@Param("userId") Long userId, @Param("filePaths") List<String> filePaths);
}

